package com.bjpower.convent;

import com.bjpower.domain.UserInfo;
import com.bjpower.models.vo.UserPageInfoVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

/**
 * 这是一个接口，用于转换UserPageInfoVo
 */
@Mapper(componentModel = "spring",uses = { MapperHelder.class })
public interface  UserPageInfoVoConvent {
    //将UserInfo对象转换为UserPageInfoVo对象@Mappings用来自定义转换规则,使用验证方法
    @Mappings({@Mapping(target = "createTime", source = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
               @Mapping(target = "status", source = "status", dateFormat = "yyyy-MM-dd HH:mm:ss", qualifiedByName = "statusConvent")})
    UserPageInfoVo toUserPageInfoVo(UserInfo userInfo);

    List<UserPageInfoVo> toUserPageInfoVoList(List<UserInfo> userInfoList);
}
